package com.yjc.drygoods.product.vo;

import com.yjc.common.to.SkuReductionTo;

import java.math.BigDecimal;
import java.util.List;

/**
 * 购物项
 *
 * @author yjc
 * @create 2022-09-20 21:31
 */
public class CartItemVo {
    private Long skuId;
    private Long spuId;
    private Boolean check = true;
    private String title;
    private String image;
    private List<String> skuAttr;
    private BigDecimal price;
//    /**
//     * 降价价格
//     */
//    private BigDecimal reducedPrice;
    private Integer count;
    private SkuReductionTo skuReduction;
    private Double weight;
    /**
     * 该购物项总价，需手动计算
     */
    private BigDecimal totalPrice;

//    public BigDecimal getReducedPrice() {
//        return reducedPrice;
//    }
//
//    public void setReducedPrice(BigDecimal reducedPrice) {
//        this.reducedPrice = reducedPrice;
//    }

    public Double getWeight() {
        return weight;
    }

    public void setWeight(Double weight) {
        this.weight = weight;
    }

    public Long getSpuId() {
        return spuId;
    }

    public void setSpuId(Long spuId) {
        this.spuId = spuId;
    }

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Boolean getCheck() {
        return check;
    }

    //设置是否被选中，默认被添加进来就会被选中
    public void setCheck(Boolean check) {
        this.check = check;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public List<String> getSkuAttr() {
        return skuAttr;
    }

    public void setSkuAttr(List<String> skuAttr) {
        this.skuAttr = skuAttr;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public SkuReductionTo getSkuReduction() {
        return skuReduction;
    }

    public void setSkuReduction(SkuReductionTo skuReduction) {
        this.skuReduction = skuReduction;
    }

    public BigDecimal getTotalPrice() {
        BigDecimal sale = this.price.multiply(new BigDecimal(this.count + ""));
        return sale;
    }

}
